package org.zsl.mybatis.app;

import org.apache.ibatis.session.SqlSession;
import org.zsl.mybatis.mapper.UserMapper2;
import org.zsl.mybatis.model.User;
import org.zsl.mybatis.util.SqlSessionFactory;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class Client10 {

    public static void main(String[] args) throws IOException {

        SqlSession session = SqlSessionFactory.getSqlSession2();

        UserMapper2 mapper2=   session.getMapper(UserMapper2.class);


        List<Integer> ids=new ArrayList<>();
        ids.add(1);
        ids.add(3);
        List<User> users=  mapper2.selectByIds(ids);

        for (User user:users) {
            System.out.println(user);
        }


        session.close();
    }
}
